package csdn.xiancheng.li01;

public class MyThread extends Thread{
    //2.重写run方法
        @Override
    public void run(){
        for (int i = 0; i < 10; i++) {
            System.out.println("在线程的run方法中");
            try {
                Thread.sleep(1000);//休眠方法抛出了异常InterruptedException
            } catch (InterruptedException e) {
        
                e.printStackTrace();
            }
            System.out.println(i);
        }
    }
}
